import sqlLite from '../../common/sqllite-utils';

/**
 * 当点击保存时，保存此条rfid的出入库数据
 */

export function saveRfiddata() {
  console.log('你好')
    sqlLite.executeSqlCode(
           	`insert into inoutTheLibraryTable (id,rfid,hb_rock_ku_shi_id,hb_rock_ku_shi_name,hb_rock_zhuangxh_id,wuping_name,xin_hao) values ("${this.form.id}","${this.RFID}","${this.form.hb_rock_ku_shi_id}","${this.form.hb_rock_ku_shi_name}","${this.form.hb_rock_zhuangxh_id}","${this.form.wuping_name}","${this.form.xin_hao}")`,
    ).then(res => {
      this.$refs.uToast.show({
        title: '插入数据成功！',
        type: 'success',
      });
    }).catch(err => {
      this.$refs.uToast.show({
        title: '插入数据失败！',
        type: 'warning',
      });
    })
    const tableName = 'inoutTheLibraryTable';
    sqlLite.selectFromTable(
               	`select * from ${tableName}`,
    ).then(res => {
      console.log(res,'出入库插入后所得到的数据')
    })
    
    // sqlLite.executeSqlCode(
    //          	'DELETE FROM inoutTheLibraryTable',
    // )

}